home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-04-29 | 1.1 KB | 57 lines | [TEXT/MACA] |
- \ 4.6.87 rfl vbl queue manipulation
- \ 1.1.88 rfl general cleanup
-
- :code vinstall
- move.l (a7)+,a0
- call vinstall
- ext.l d0
- move.l d0,-(a7)
- ;code
-
- :code vremove
- move.l (a7)+,a0
- call vremove
- ext.l d0
- move.l d0,-(a7)
- ;code
-
-
-
- :CLASS vbl <super object
-
- var qlink
- int qtype
- var procPtr
- int vblCount
- int vblPhase
-
- ( 1/60ths of second -- )
- :M SetDelay: put: vblCount ;M
-
- ( cfaProc -- errcode)
- :M install: >body +base put: procptr abs: self vinstall abort" install error" ;M
-
- ( -- errcode)
- :M remove: abs: self vremove . ;M
-
- :M classinit: 1 put: qtype ;M
-
- ;class
-
- vbl myTask
-
- \ Now to use this, create a :proc definition which is the background task
- \ you want to perform. You can set the delay (in 1/60ths
- \ of a second) for periodic execution using the setDelay: method. The
- \ task itself must reset this delay everytime it executes. The task
- \ should ultimately be written in assembly, since all other events
- \ are on hold while your word is being executed.
-
- \ example below
-
- \ :Proc beeper 1 beep 120 setdelay: myTask ;proc
- \ 120 setdelay: myTask
- \ 'c beeper install: myTask
- \ to remove, say remove: myTask
-
-